# -*- coding: utf-8 -*-
=begin
  Copyright (C) 2014 Takashi SUGA

  You may use and/or modify this file according to the license
  described in the LICENSE.txt file included in this archive.
=end

module MiniTest

  class Shire < MiniTest::TestCase
    def test_shire
      date = When.when? '2001.1.1^^Shire?time_basis=+09:00'
      [["2001-01-01", 2451901],
       ["2002-01-01", 2452266],
       ["2003-01-01", 2452632],
       ["2004-01-01", 2452997],
       ["2005-01-01", 2453362],
       ["2006-01-01", 2453727],
       ["2007-01-01", 2454093],
       ["2008-01-01", 2454458],
       ["2009-01-01", 2454823],
       ["2010-01-01", 2455188],
       ["2011-01-01", 2455554],
       ["2012-01-01", 2455919],
       ["2013-01-01", 2456284],
       ["2014-01-01", 2456649],
       ["2015-01-01", 2457015],
       ["2016-01-01", 2457380],
       ["2017-01-01", 2457745],
       ["2018-01-01", 2458110],
       ["2019-01-01", 2458476],
       ["2020-01-01", 2458841],
       ["2021-01-01", 2459206],
       ["2022-01-01", 2459571],
       ["2023-01-01", 2459936],
       ["2024-01-01", 2460302],
       ["2025-01-01", 2460667],
       ["2026-01-01", 2461032],
       ["2027-01-01", 2461397],
       ["2028-01-01", 2461763],
       ["2029-01-01", 2462128],
       ["2030-01-01", 2462493],
       ["2031-01-01", 2462858],
       ["2032-01-01", 2463224],
       ["2033-01-01", 2463589]].each do |sample|
        assert_equal(sample, [date.to_s, date.to_i])
        date += When::P1Y
      end

      date = When.when? '2001.1.1'
      400.times do
        assert_equal([1,9], (When.Calendar('Shire') ^ date).cal_date[1..2])
        date += When::P1Y
      end
    end
  end
end
